using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class OE_PolicyMap : EntityTypeConfiguration<OE_Policy>
    {
        public OE_PolicyMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Conditions)
                .HasMaxLength(100);

            this.Property(t => t.Visibility)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("OE_Policy");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.OrderType).HasColumnName("OrderType");
            this.Property(t => t.Conditions).HasColumnName("Conditions");
            this.Property(t => t.Visibility).HasColumnName("Visibility");
        }
    }
}
